#Region "File Description"
'-----------------------------------------------------------------------------
' MainMenuScreen.cs
'
' Microsoft XNA Community Game Platform
' Copyright (C) Microsoft Corporation. All rights reserved.
'-----------------------------------------------------------------------------
#End Region

#Region "Using Statements"
Imports Microsoft.Xna.Framework
#End Region

''' <summary>
''' The main menu screen is the first thing displayed when the game starts up.
''' </summary>
Class MainMenuScreen
	Inherits MenuScreen
	#Region "Initialization"


	''' <summary>
	''' Constructor fills in the menu contents.
	''' </summary>
	Public Sub New()
		MyBase.New(String.Empty)
		' Create our menu entries.
		Dim playGameMenuEntry As New MenuEntry(String.Empty)
		'MenuEntry optionsMenuEntry = new MenuEntry("Options");
		'MenuEntry exitMenuEntry = new MenuEntry(string.Empty);

		' Hook up menu event handlers.
		AddHandler playGameMenuEntry.Selected, AddressOf PlayGameMenuEntrySelected
		'optionsMenuEntry.Selected += OptionsMenuEntrySelected;
		'exitMenuEntry.Selected += OnCancel;

		' Add entries to the menu.
			'MenuEntries.Add(optionsMenuEntry);
			'MenuEntries.Add(exitMenuEntry);
		MenuEntries.Add(playGameMenuEntry)
	End Sub


	#End Region

	#Region "Handle Input"


	''' <summary>
	''' Event handler for when the Play Game menu entry is selected.
	''' </summary>
	Private Sub PlayGameMenuEntrySelected(sender As Object, e As PlayerIndexEventArgs)
		'LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,new GameplayScreen());
		LoadingScreen.Load(ScreenManager, True, e.PlayerIndex, New PrinceOfPersiaGame())
	End Sub


	''' <summary>
	''' Event handler for when the Options menu entry is selected.
	''' </summary>
	Private Sub OptionsMenuEntrySelected(sender As Object, e As PlayerIndexEventArgs)
		ScreenManager.AddScreen(New OptionsMenuScreen(), e.PlayerIndex)
	End Sub


	''' <summary>
	''' When the user cancels the main menu, ask if they want to exit the sample.
	''' </summary>
	Protected Overrides Sub OnCancel(playerIndex As PlayerIndex)
		Const  message As String = "Are you sure you want to exit this sample?"

		Dim confirmExitMessageBox As New MessageBoxScreen(message)

		AddHandler confirmExitMessageBox.Accepted, AddressOf ConfirmExitMessageBoxAccepted

		ScreenManager.AddScreen(confirmExitMessageBox, playerIndex)
	End Sub


	''' <summary>
	''' Event handler for when the user selects ok on the "are you sure
	''' you want to exit" message box.
	''' </summary>
	Private Sub ConfirmExitMessageBoxAccepted(sender As Object, e As PlayerIndexEventArgs)
		ScreenManager.Game.[Exit]()
	End Sub


	#End Region
End Class
